/*
 * @Author: cui DengKe
 * @Date: 2021-06-11 22:10:32
 * @LastEditors: cui DengKe
 * @LastEditTime: 2021-06-11 22:10:46
 * @Description: 校验工具
 * @FilePath: \node-server\validator\is-empty\index.js
 */

const isEmpty = value => {
  return (
    value == undefined ||
    value === null ||
    (typeof value === 'object' && Object.keys(value).length === 0) ||
    (typeof value === 'string' && value.trim().length === 0)
  );
};

module.exports = isEmpty;